package com.cssy.xxkj.logic.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.logic.dao.LogicAllocationItemDAO;
import com.cssy.xxkj.logic.entity.LogicAllocationItemDO;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;

public class LogicAllocationItemDAOImpl extends SqlMapClientDaoSupport
		implements LogicAllocationItemDAO {
	
	@Override
	public String insertLogicAllocationItemDO(
			LogicAllocationItemDO logicAllocationItemDO) {
		Object id = getSqlMapClientTemplate().insert("LogicAllocationItem.insert", logicAllocationItemDO);
        return (String) id;
	}

	@Override
	public Integer countLogicAllocationItemDOByExample(
			LogicAllocationItemDO logicAllocationItemDO) {
		 Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicAllocationItem.countByDOExample", logicAllocationItemDO);
	     return count;
	}

	@Override
	public Integer updateLogicAllocationItemDO(
			LogicAllocationItemDO logicAllocationItemDO) {
		int result = getSqlMapClientTemplate().update("LogicAllocationItem.update", logicAllocationItemDO);
        return result;
	}

	@Override
	public List<LogicAllocationItemDO> findListByExample(
			LogicAllocationItemDO logicAllocationItemDO) {
		List<LogicAllocationItemDO> list = getSqlMapClientTemplate().queryForList("LogicAllocationItem.findListByDO", logicAllocationItemDO);
        return list;
	}

	@Override
	public List<LogicAllocationItemDO> findListByMap(
			Map<String, Object> paramMap) throws SyBaseException {
		return getSqlMapClientTemplate().queryForList("LogicAllocationItem_ex.findListByMap", paramMap);
	}

	@Override
	public LogicAllocationItemDO findLogicAllocationItemDOByPrimaryKey(String id) {
		LogicAllocationItemDO logicAllocationItemDO = (LogicAllocationItemDO) getSqlMapClientTemplate().queryForObject("LogicAllocationItem.findByPrimaryKey", id);
        return logicAllocationItemDO;
	}

	@Override
	public Integer deleteLogicAllocationItemDOByPrimaryKey(String id) {
		 Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicAllocationItem.deleteByPrimaryKey", id);
	     return rows;
	}

	@Override
	public List<LogicAllocationItemDO> find(SearchConditions scs)
			throws DataAccessException {
		List<LogicAllocationItemDO> list = getSqlMapClientTemplate().queryForList("LogicAllocationItem_ex.find", scs);
	     return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicAllocationItem_ex.count", scs);
        return count;
	}

	@Override
	public Integer deleteBizRemoved(String id) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

}
